package oop.day01;
public class Car
{
    // new 会给属性赋 默认值   对象的默认值为  null
    String brand;
    String color;
    double price;
    int capacity;
    Car(){
        System.out.println("Constructor without argument");
    };

    //          凯迪拉克        red         199999      5
    Car(String brand,String color,double price,int capacity)
    {
        // 一般 同名变量都就近取
        this.brand = brand;         // car1.brand = "";
        this.color = color;         // car1.color = "";
        this.price = price;         // car1.price = 199999;
        this.capacity = capacity;   // car1.capacity = 5;
        System.out.println("Constructor with four arguments");
    }

    Car(String brand)
    {
        this.brand = brand;
        System.out.println("Constructor with a argument");
    }

    Car(String brand,String color)
    {
        this.brand = brand;
        this.color = color;
        System.out.println("Constructor with two arguments");
    }
    Car(String brand,String color,double price)
    {
        this.brand = brand;
        this.color = color;
        this.price = price;
        System.out.println("Constructor with three arguments");
    }
    // 系统自己传了一个this
    void run()
    {
        System.out.println(this.brand + "牌子的"+this.color+"色的"+this.brand+"容量的"+this.price+"块钱的车 启动了");
    }
    void stop()
    {
        System.out.println(this.brand + "牌子的"+this.color+"色的"+this.capacity+"容量的"+this.price+"块钱的车停止了");
    }
}
